package equipe2msvy.ProjectServeurApplication.beans;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import javax.persistence.Entity;

@Entity
@Table(name="CONTRAT")
@Inheritance(strategy =InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="TYPE" , length = 12)
public class Contrat implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="ID_CONTRAT")
	private int idContrat;
	@Column(name="NOM")
	private String nom;
	@ManyToOne
	@JoinColumn(name="ID_OFFRE")
	private Offre offre;
	public Contrat(String nom) {
		super();
		this.nom = nom;
	}
	public Contrat() {
		super();
		// TODO Auto-generated constructor stub
	}
	public int getIdContrat() {
		return idContrat;
	}
	public void setIdContrat(int idContrat) {
		this.idContrat = idContrat;
	}
	public String getNom() {
		return nom;
	}
	public void setNom(String nom) {
		this.nom = nom;
	}
	public Offre getOffre() {
		return offre;
	}
	public void setOffre(Offre offre) {
		this.offre = offre;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
